﻿using Ivory;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using DefCore.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using DefCore.Mapping;
using DefCore;
using DefCore.Tools;
using Krypton.Lights;
using Krypton;
using DefCore.Structures;

namespace Defender.Framework
{
    public sealed class WaterCell : CellBase
    {
        public override ShadowHull CellShadowHull
        {
            get
            {
                return null;
            }
        }
        public override Light2D CellLight
        {
            get
            {
               var result = LightFactory.CreateLight(300, Color.LightBlue, .55f);
               result.Position = MapPosition.CenterTile;
               result.ShadowType = ShadowType.Illuminated;
               return result;
            }
        }

        public override CellFrameType ValidFrameTypes
        {
            get
            {
                return CellFrameType.FULLFRAME;
            }
        }
        public override bool IsBuildable
        {
            get { return true; }
        }
        public override bool IsWalkable
        {
            get { return StructureAllowsWalking; }
        }

        public bool StructureAllowsWalking { get; set; }

        //ctor
        public WaterCell(DungeonPos pos)
            : base(pos, false)
        {
            this.IsSelectable = false;
            StructureAllowsWalking = false;
        }

        //Methods
        protected override void DrawCell(SpriteBatch batch, Rectangle drawingRect)
        {
            batch.Draw(TileBin.Instance.GetTile((int)CellConverterEnum.Water), drawingRect, Color.White);
        }
        protected override void SolveCell(InputControl control, GameTime time)
        {

        }
    }
}
